
Include 3rdparty directory into the main build-system.

Original author is unknown.
(Was either Juan Quintela or Jeff Garzik)

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Thomas Backlund <tmb@mageia.org>

 Makefile                 |    2 +-
 arch/alpha/Kconfig       |    1 +
 arch/ia64/Kconfig        |    2 ++
 arch/mips/Kconfig        |    2 ++
 arch/powerpc/Kconfig     |    2 ++
 arch/sparc/Kconfig       |    2 ++
 arch/x86/Kconfig         |    2 ++
 scripts/kconfig/Makefile |   33 ++++++++++++++++++---------------
 8 files changed, 30 insertions(+), 16 deletions(-)

diff -Nurp linux-4.2.2/arch/alpha/Kconfig linux-4.2.2-3rd/arch/alpha/Kconfig
--- linux-4.2.2/arch/alpha/Kconfig	2015-08-30 21:34:09.000000000 +0300
+++ linux-4.2.2-3rd/arch/alpha/Kconfig	2015-09-29 23:02:44.024347272 +0300
@@ -750,3 +750,4 @@ source "crypto/Kconfig"
 
 source "lib/Kconfig"
 
+source "3rdparty/Kconfig"
diff -Nurp linux-4.2.2/arch/ia64/Kconfig linux-4.2.2-3rd/arch/ia64/Kconfig
--- linux-4.2.2/arch/ia64/Kconfig	2015-08-30 21:34:09.000000000 +0300
+++ linux-4.2.2-3rd/arch/ia64/Kconfig	2015-09-29 23:02:44.024347272 +0300
@@ -613,3 +613,5 @@ source "lib/Kconfig"
 
 config IOMMU_HELPER
 	def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
+
+source "3rdparty/Kconfig"
diff -Nurp linux-4.2.2/arch/mips/Kconfig linux-4.2.2-3rd/arch/mips/Kconfig
--- linux-4.2.2/arch/mips/Kconfig	2015-08-30 21:34:09.000000000 +0300
+++ linux-4.2.2-3rd/arch/mips/Kconfig	2015-09-29 23:02:44.024347272 +0300
@@ -2944,3 +2944,5 @@ source "crypto/Kconfig"
 source "lib/Kconfig"
 
 source "arch/mips/kvm/Kconfig"
+
+source "3rdparty/Kconfig"
diff -Nurp linux-4.2.2/arch/powerpc/Kconfig linux-4.2.2-3rd/arch/powerpc/Kconfig
--- linux-4.2.2/arch/powerpc/Kconfig	2015-08-30 21:34:09.000000000 +0300
+++ linux-4.2.2-3rd/arch/powerpc/Kconfig	2015-09-29 23:02:44.025347276 +0300
@@ -1112,3 +1112,5 @@ config PPC_LIB_RHEAP
 source "arch/powerpc/kvm/Kconfig"
 
 source "kernel/livepatch/Kconfig"
+
+source "3rdparty/Kconfig"
diff -Nurp linux-4.2.2/arch/sparc/Kconfig linux-4.2.2-3rd/arch/sparc/Kconfig
--- linux-4.2.2/arch/sparc/Kconfig	2015-08-30 21:34:09.000000000 +0300
+++ linux-4.2.2-3rd/arch/sparc/Kconfig	2015-09-29 23:02:44.025347276 +0300
@@ -569,3 +569,5 @@ source "security/Kconfig"
 source "crypto/Kconfig"
 
 source "lib/Kconfig"
+
+source "3rdparty/Kconfig"
diff -Nurp linux-4.2.2/arch/x86/Kconfig linux-4.2.2-3rd/arch/x86/Kconfig
--- linux-4.2.2/arch/x86/Kconfig	2015-08-30 21:34:09.000000000 +0300
+++ linux-4.2.2-3rd/arch/x86/Kconfig	2015-09-29 23:02:44.025347276 +0300
@@ -2601,3 +2601,5 @@ source "crypto/Kconfig"
 source "arch/x86/kvm/Kconfig"
 
 source "lib/Kconfig"
+
+source "3rdparty/Kconfig"
diff -Nurp linux-4.2.2/Makefile linux-4.2.2-3rd/Makefile
--- linux-4.2.2/Makefile	2015-09-29 22:13:44.743650710 +0300
+++ linux-4.2.2-3rd/Makefile	2015-09-29 23:02:44.026347280 +0300
@@ -546,7 +546,7 @@ scripts: scripts_basic include/config/au
 
 # Objects we will link into vmlinux / subdirs we need to visit
 init-y		:= init/
-drivers-y	:= drivers/ sound/ firmware/
+drivers-y	:= drivers/ sound/ firmware/ 3rdparty/
 net-y		:= net/
 libs-y		:= lib/
 core-y		:= usr/
diff -Nurp linux-4.9/scripts/kconfig/Makefile linux-4.9-3rd/scripts/kconfig/Makefile
--- linux-4.9/scripts/kconfig/Makefile
+++ linux-4.9-3rd/scripts/kconfig/Makefile
@@ -18,28 +18,28 @@ endif
 # We need this, in case the user has it in its environment
 unexport CONFIG_
 
-xconfig: $(obj)/qconf
+xconfig: $(obj)/qconf 3rdparty/Makefile
 	$< $(silent) $(Kconfig)
 
-gconfig: $(obj)/gconf
+gconfig: $(obj)/gconf 3rdparty/Makefile
 	$< $(silent) $(Kconfig)
 
-menuconfig: $(obj)/mconf
+menuconfig: $(obj)/mconf 3rdparty/Makefile
 	$< $(silent) $(Kconfig)
 
-config: $(obj)/conf
+config: $(obj)/conf 3rdparty/Makefile
 	$< $(silent) --oldaskconfig $(Kconfig)
 
-nconfig: $(obj)/nconf
+nconfig: $(obj)/nconf 3rdparty/Makefile
 	$< $(silent) $(Kconfig)
 
-silentoldconfig: $(obj)/conf
+silentoldconfig: $(obj)/conf 3rdparty/Makefile
 	$(Q)mkdir -p include/config include/generated
 	$(Q)test -e include/generated/autoksyms.h || \
 	    touch   include/generated/autoksyms.h
 	$< $(silent) --$@ $(Kconfig)
 
-localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
+localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 3rdparty/Makefile
 	$(Q)mkdir -p include/config include/generated
 	$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
 	$(Q)if [ -f .config ]; then 					\
@@ -82,7 +82,7 @@ simple-targets := oldconfig allnoconfig
 	alldefconfig randconfig listnewconfig olddefconfig
 PHONY += $(simple-targets)
 
-$(simple-targets): $(obj)/conf
+$(simple-targets): $(obj)/conf 3rdparty/Makefile
 	$< $(silent) --$@ $(Kconfig)
 
 PHONY += oldnoconfig savedefconfig defconfig
@@ -90,12 +90,12 @@ PHONY += oldnoconfig savedefconfig defco
 # oldnoconfig is an alias of olddefconfig, because people already are dependent
 # on its behavior (sets new symbols to their default value but not 'n') with the
 # counter-intuitive name.
-oldnoconfig: olddefconfig
+oldnoconfig: olddefconfig 3rdparty/Makefile
 
-savedefconfig: $(obj)/conf
+savedefconfig: $(obj)/conf 3rdparty/Makefile
 	$< $(silent) --$@=defconfig $(Kconfig)
 
-defconfig: $(obj)/conf
+defconfig: $(obj)/conf 3rdparty/Makefile
 ifeq ($(KBUILD_DEFCONFIG),)
 	$< $(silent) --defconfig $(Kconfig)
 else
@@ -108,26 +108,26 @@ else
 endif
 endif
 
-%_defconfig: $(obj)/conf
+%_defconfig: $(obj)/conf 3rdparty/Makefile
 	$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
 configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@)
 
-%.config: $(obj)/conf
+%.config: $(obj)/conf 3rdparty/Makefile
 	$(if $(call configfiles),, $(error No configuration exists for this target on this architecture))
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles)
 	+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
 
 PHONY += kvmconfig
-kvmconfig: kvm_guest.config
+kvmconfig: kvm_guest.config 3rdparty/Makefile
 	@:
 
 PHONY += xenconfig
-xenconfig: xen.config
+xenconfig: xen.config 3rdparty/Makefile
 	@:
 
 PHONY += tinyconfig
-tinyconfig:
+tinyconfig: 
 	$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
 
 # Help text used by make help
@@ -190,6 +190,9 @@ gconf-objs	:= gconf.o zconf.tab.o
 
 hostprogs-y := conf nconf mconf kxgettext qconf gconf
 
+3rdparty/Makefile:
+	pushd $(srctree)/3rdparty ; $(PERL) ./mkbuild.pl ; popd
+
 clean-files	:= qconf.moc .tmp_qtcheck .tmp_gtkcheck
 clean-files	+= zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
 clean-files     += config.pot linux.pot
